package main

import (
	"db_ping/shell"
	"fmt"
	"time"
)

func main() {
	//client:= shell.NewShellPwd("root", "12345Abc", "39.97.187.111", 22,time.Second)
	client := shell.NewShellPublicKey("root", "C:\\Users\\dingguangyi\\.ssh\\id_rsa", "39.97.187.111", time.Second, 22)
	defer client.Close()
	b, _ := client.Run("ps -aux|grep md|grep -v grep|awk '{print $2}'")
	fmt.Println(b)
	b1, _ := client.Run("pwd")
	fmt.Println(b1)
	b2, _ := client.Run("cd /home/yc")
	fmt.Println(b2)
	b3, _ := client.Run("pwd")
	fmt.Println(b3)
	b4, _ := client.Run("sh /home/yc/test.sh")
	fmt.Println(b4)
}
